home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / Exec.mod < prev    next >
Text File  |  1995-06-29  |  55KB  |  1,705 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: Exec.mod $
  4.   Description: Interface to exec.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. *************************************************************************)
  21.  
  22. <* STANDARD- *>
  23.  
  24. MODULE [2] Exec;
  25.  
  26. IMPORT SYS := SYSTEM, s := Sets;
  27.  
  28. (**-- Pointer declarations ---------------------------------------------*)
  29.  
  30. TYPE
  31.  
  32.   MinNodePtr*          = POINTER TO MinNode;
  33.   NodePtr*             = POINTER TO Node;
  34.   MinListPtr*          = POINTER TO MinList;
  35.   ListPtr*             = POINTER TO List;
  36.   ResidentPtr*         = POINTER TO Resident;
  37.   MemChunkPtr*         = POINTER TO MemChunk;
  38.   MemHeaderPtr*        = POINTER TO MemHeader;
  39.   MemEntryPtr*         = POINTER TO MemEntry;
  40.   MemListPtr*          = POINTER TO MemList;
  41.   TaskPtr*             = POINTER TO Task;
  42.   StackSwapStructPtr*  = POINTER TO StackSwapStruct;
  43.   MsgPortPtr*          = POINTER TO MsgPort;
  44.   MsgPortSoftIntPtr*   = POINTER TO MsgPortSoftInt;
  45.   MessagePtr*          = POINTER TO Message;
  46.   InterruptPtr*        = POINTER TO Interrupt;
  47.   IntVectorPtr         = POINTER TO IntVector;
  48.   SoftIntListPtr       = POINTER TO SoftIntList;
  49.   SemaphoreRequestPtr  = POINTER TO SemaphoreRequest;
  50.   SignalSemaphorePtr*  = POINTER TO SignalSemaphore;
  51.   SemaphorePtr*        = POINTER TO Semaphore;
  52.   LibraryPtr*          = POINTER TO Library;
  53.   DevicePtr*           = POINTER TO Device;
  54.   UnitPtr*             = POINTER TO Unit;
  55.   IORequestPtr*        = POINTER TO IORequest;
  56.   IOStdReqPtr*         = POINTER TO IOStdReq;
  57.   ExecBasePtr*         = POINTER TO ExecBase;
  58.   MemHandlerDataPtr *  = POINTER TO MemHandlerData;
  59.   MemPoolPtr *         = POINTER TO RECORD END;
  60.  
  61.  
  62. (**-- Library definitions ----------------------------------------------*)
  63.  
  64. (*
  65. **      $VER: initializers.h 39.0 (15.10.91)
  66. **
  67. **      Macros for use with the InitStruct() function.
  68. **
  69. **      Not ported.
  70. *)
  71.  
  72. (*
  73. **      $VER: types.h 40.1 (10.8.93)
  74. **
  75. **      Data typing.
  76. *)
  77.  
  78. CONST
  79.  
  80.   includeVersion* = 40; (* Version of the include files in use. (Do not
  81.                           use this label for OpenLibrary() calls!) *)
  82.  
  83. TYPE
  84.  
  85.   (*  WARNING: APTR was redefined for the V36 Includes!  APTR is a   *)
  86.  (*  32-Bit Absolute Memory Pointer.  C pointer math will not       *)
  87. (*  operate on APTR --  use "ULONG *" instead.                     *)
  88.  
  89.   ADDRESS * = SYS.ADDRESS;
  90.   APTR    * = SYS.ADDRESS;         (* 32-bit untyped pointer *)
  91.   BPTR    * = SYS.BPTR;
  92.  
  93.   LONG    * = LONGINT;             (* signed 32-bit quantity *)
  94.   ULONG   * = LONGINT;             (* unsigned 32-bit quantity *)
  95.   LONGBITS* = s.SET32;             (* 32 bits manipulated individually *)
  96.   WORD    * = INTEGER;             (* signed 16-bit quantity *)
  97.   UWORD   * = INTEGER;             (* unsigned 16-bit quantity *)
  98.   WORDBITS* = s.SET16;             (* 16 bits manipulated individually *)
  99.   BYTE    * = SYS.BYTE;            (* signed 8-bit quantity *)
  100.   UBYTE   * = SYS.BYTE;            (* unsigned 8-bit quantity *)
  101.   BYTEBITS* = s.SET8;              (* 8 bits manipulated individually *)
  102.   RPTR    * = INTEGER;             (* signed relative pointer *)
  103.   STRING  * = ARRAY 256 OF CHAR;
  104.   STRPTR  * = POINTER TO STRING;   (* string pointer (NULL terminated) *)
  105.   LSTRPTR * = POINTER TO ARRAY MAX(INTEGER)-1 OF CHAR;
  106.  
  107.  
  108. (* For compatibility only: (don't use in new code) *)
  109.   SHORT   * = INTEGER;             (* signed 16-bit quantity (use WORD) *)
  110.   USHORT  * = INTEGER;             (* unsigned 16-bit quantity (use UWORD) *)
  111.   COUNT   * = INTEGER;
  112.   UCOUNT  * = INTEGER;
  113.   CPTR    * = ULONG;
  114.  
  115.  
  116. (* Types with specific semantics *)
  117.   FLOAT   * = REAL;
  118.   DOUBLE  * = ARRAY 2 OF SYS.LONGWORD;
  119.   SINGLE  * = SYS.LONGWORD;
  120.   BOOL    * = INTEGER;
  121.   TEXT    * = CHAR;
  122.  
  123. CONST
  124.  
  125.   null           * = NIL;
  126.   byteMask       * = 0FFH;
  127.  
  128. (* Types convenient for Oberon-A programmers *)
  129.  
  130. TYPE
  131.  
  132.   PROC     * = PROCEDURE;
  133.   LBOOL    * = LONGINT;
  134.   LONGBOOL * = LBOOL;
  135.  
  136. (* Legal values for LBOOL types *)
  137.  
  138. CONST
  139.  
  140.   true   * = 1;
  141.   false  * = 0;
  142.   LTRUE  * = -1;
  143.   LFALSE * = 0;
  144.  
  145. (* Use these constants instead of the corresponding literals when passing
  146. ** parameters to Amiga library functions. This will result in clearer
  147. ** code, and will also assist when porting code to and from AmigaOberon.
  148. *)
  149.  
  150. CONST
  151.  
  152.   NILSTR   * = "";   (* Use when a NULL would be passed in C *)
  153.   EMPTYSTR * = "\o"; (* Use when an empty string would be passed in C *)
  154.  
  155.  (*   libraryVersion is now obsolete.  Please use libraryMinimum *)
  156. (* or code the specific minimum library version you require.            *)
  157.  
  158.   libraryMinimum* = 33; (* Lowest version supported by Commodore-Amiga *)
  159.  
  160. (*
  161. **      $VER: nodes.h 39.0 (15.10.91)
  162. **
  163. **      Nodes & Node type identifiers.
  164. *)
  165.  
  166. TYPE
  167.  
  168. (*
  169.  * Type compatible to MinNode and Node:
  170.  *)
  171.   CommonNode * = RECORD END;
  172.   CommonNodePtr * = POINTER TO CommonNode;
  173.  
  174. (*
  175.  *  List Node Structure.  Each member in a list starts with a Node
  176.  *)
  177.  
  178.   NodeBase *= RECORD (CommonNode) END;
  179.   Node * = RECORD (NodeBase)
  180.     succ* : NodePtr;   (* Pointer to next (successor) *)
  181.     pred* : NodePtr;   (* Pointer to previous (predecessor) *)
  182.     type* : SHORTINT;
  183.     pri*  : SHORTINT;  (* Priority, for sorting *)
  184.     name* : LSTRPTR;   (* ID string, null terminated *)
  185.   END; (* Node *)      (* Note: word aligned *)
  186.  
  187. (* minimal node -- no type checking possible *)
  188.  
  189.   MinNodeBase *= RECORD (CommonNode) END;
  190.   MinNode * = RECORD (MinNodeBase)
  191.     succ* : MinNodePtr;      (* Pointer to next (successor) *)
  192.     pred* : MinNodePtr;      (* Pointer to previous (predecessor) *)
  193.   END; (* MinNode *)
  194.  
  195.  
  196. CONST
  197.  
  198. (*
  199. ** Note: Newly initialized IORequests, and software interrupt structures
  200. ** used with Cause(), should have type ntUNKNOWN.  The OS will assign a type
  201. ** when they are first used.
  202. *)
  203. (* ----- Node Types for Node.type -----*)
  204.   unknown     * = 0;
  205.   task        * = 1;       (* Exec task *)
  206.   interrupt   * = 2;
  207.   device      * = 3;
  208.   msgPort     * = 4;
  209.   message     * = 5;       (* Indicates message currently pending *)
  210.   freeMsg     * = 6;
  211.   replyMsg    * = 7;       (* Message has been replied *)
  212.   resource    * = 8;
  213.   library     * = 9;
  214.   memory      * = 10;
  215.   softInt     * = 11;      (* Internal flag used by SoftInits *)
  216.   font        * = 12;
  217.   process     * = 13;      (* AmigaDOS Process *)
  218.   semaphore   * = 14;
  219.   signalSem   * = 15;      (* signal semaphores *)
  220.   bootNode    * = 16;
  221.   kickMem     * = 17;
  222.   graphics    * = 18;
  223.   deathMessage* = 19;
  224.   user        * = 254;     (* User node types work down from here *)
  225.   extended    * = 255;
  226.  
  227. (*
  228. **      $VER: lists.h 39.0 (15.10.91)
  229. **
  230. **      Definitions and macros for use with Exec lists
  231. *)
  232.  
  233. TYPE
  234.  
  235. (*
  236.  * Type compatible to MinList and List:
  237.  *)
  238.   CommonList * = RECORD END;
  239.   CommonListPtr * = POINTER TO CommonList;
  240.  
  241. (*
  242.  *  Full featured list header.
  243.  *)
  244.   List* = RECORD (CommonList)
  245.     head*     : NodePtr;
  246.     tail*     : NodePtr;
  247.     tailPred* : NodePtr;
  248.     type*     : SHORTINT;
  249.     pad*      : BYTE;
  250.   END; (* List *)      (* word aligned *)
  251.  
  252. (*
  253.  * Minimal List Header - no type checking
  254.  *)
  255.   MinList* = RECORD (CommonList)
  256.     head*     : MinNodePtr;
  257.     tail*     : MinNodePtr;
  258.     tailPred* : MinNodePtr;
  259.   END; (* MinList *)      (* longword aligned *)
  260.  
  261.  
  262. (*
  263. **      $VER: alerts.h 39.3 (12.5.92)
  264. **
  265. **      Alert numbers, as displayed by system crashes.
  266. *)
  267.  
  268. (*********************************************************************
  269. *
  270. *  Format of the alert error number:
  271. *
  272. *    +-+-------------+----------------+--------------------------------+
  273. *    |D|  SubSysId   |  General Error |    SubSystem Specific Error    |
  274. *    +-+-------------+----------------+--------------------------------+
  275. *     1    7 bits          8 bits                  16 bits
  276. *
  277. *                    D:  DeadEnd alert
  278. *             SubSysId:  indicates ROM subsystem number.
  279. *        General Error:  roughly indicates what the error was
  280. *       Specific Error:  indicates more detail
  281. **********************************************************************)
  282.  
  283. (**********************************************************************
  284. *
  285. *  Hardware/CPU specific alerts:  They may show without the 8 at the
  286. *  front of the number.  These are CPU/68000 specific.  See 680x0
  287. *  programmer's manuals for more details.
  288. *
  289. **********************************************************************)
  290.  
  291. CONST
  292.  
  293.   acpuBusErr     * = 080000002H;  (* Hardware bus fault/access error *)
  294.   acpuAddressErr * = 080000003H;  (* Illegal address access (ie: odd) *)
  295.   acpuInstErr    * = 080000004H;  (* Illegal instruction *)
  296.   acpuDivZero    * = 080000005H;  (* Divide by zero *)
  297.   acpuCHK        * = 080000006H;  (* Check instruction error *)
  298.   acpuTRAPV      * = 080000007H;  (* TrapV instruction error *)
  299.   acpuPrivErr    * = 080000008H;  (* Privilege violation error *)
  300.   acpuTrace      * = 080000009H;  (* Trace error *)
  301.   acpuLineA      * = 08000000AH;  (* Line 1010 Emulator error *)
  302.   acpuLineF      * = 08000000BH;  (* Line 1111 Emulator error *)
  303.   acpuFormat     * = 08000000EH;  (* Stack frame format error *)
  304.   acpuSpurious   * = 080000018H;  (* Spurious interrupt error *)
  305.   acpuAutoVec1   * = 080000019H;  (* AutoVector Level 1 interrupt error *)
  306.   acpuAutoVec2   * = 08000001AH;  (* AutoVector Level 2 interrupt error *)
  307.   acpuAutoVec3   * = 08000001BH;  (* AutoVector Level 3 interrupt error *)
  308.   acpuAutoVec4   * = 08000001CH;  (* AutoVector Level 4 interrupt error *)
  309.   acpuAutoVec5   * = 08000001DH;  (* AutoVector Level 5 interrupt error *)
  310.   acpuAutoVec6   * = 08000001EH;  (* AutoVector Level 6 interrupt error *)
  311.   acpuAutoVec7   * = 08000001FH;  (* AutoVector Level 7 interrupt error *)
  312.  
  313. (*********************************************************************
  314. *
  315. *  General Alerts
  316. *
  317. *  For example: timer.device cannot open math.library would be 05038015H
  318. *
  319. *       alert(an_timerdev|ag_openlib|ao_MathLib);
  320. *
  321. *********************************************************************)
  322.  
  323. CONST
  324.  
  325. (* ------ alert types *)
  326.   deadEnd     * = 80000000H;
  327.   recovery    * = 00000000H;
  328.  
  329.  
  330. (* ------ general purpose alert codes *)
  331.   noMemory    * = 00010000H;
  332.   makeLib     * = 00020000H;
  333.   openLib     * = 00030000H;
  334.   openDev     * = 00040000H;
  335.   openRes     * = 00050000H;
  336.   ioError     * = 00060000H;
  337.   noSignal    * = 00070000H;
  338.   badParm     * = 00080000H;
  339.   closeLib    * = 00090000H;      (* usually too many closes *)
  340.   closeDev    * = 000A0000H;      (* or a mismatched close *)
  341.   procCreate  * = 000B0000H;      (* Process creation failed *)
  342.  
  343.  
  344. (* ------ alert objects: *)
  345.   execLib     * = 00008001H;
  346.   graphicsLib * = 00008002H;
  347.   layersLib   * = 00008003H;
  348.   intuition   * = 00008004H;
  349.   mathLib     * = 00008005H;
  350.   dosLib      * = 00008007H;
  351.   ramLib      * = 00008008H;
  352.   iconLib     * = 00008009H;
  353.   expansionLib* = 0000800AH;
  354.   diskfontLib * = 0000800BH;
  355.   utilityLib  * = 0000800CH;
  356.   keyMapLib   * = 0000800DH;
  357.  
  358.   audioDev    * = 00008010H;
  359.   consoleDev  * = 00008011H;
  360.   gamePortDev * = 00008012H;
  361.   keyboardDev * = 00008013H;
  362.   trackDiskDev* = 00008014H;
  363.   timerDev    * = 00008015H;
  364.  
  365.   ciaRsrc     * = 00008020H;
  366.   diskRsrc    * = 00008021H;
  367.   miscRsrc    * = 00008022H;
  368.  
  369.   bootStrap   * = 00008030H;
  370.   workbench   * = 00008031H;
  371.   diskCopy    * = 00008032H;
  372.   gadTools    * = 00008033H;
  373.   atUnknown   * = 00008035H;
  374.  
  375.  
  376.  
  377. (*********************************************************************
  378. *
  379. *   Specific Alerts:
  380. *
  381. *********************************************************************)
  382.  
  383. (* ------ exec.library *)
  384.   anExecLib    * = 01000000H;
  385.   excptVect    * = 01000001H; (* 68000 exception vector checksum (obs.) *)
  386.   baseChkSum   * = 01000002H; (* Execbase checksum (obs.) *)
  387.   libChkSum    * = 01000003H; (* Library checksum failure *)
  388.  
  389.   memCorrupt   * = 81000005H; (* Corrupt memory list detected in FreeMem *)
  390.   intrMem      * = 81000006H; (* No memory for interrupt servers *)
  391.   initAPtr     * = 01000007H; (* InitStruct() of an APTR source (obs.) *)
  392.   semCorrupt   * = 01000008H; (* A semaphore is in an illegal state
  393.                                       at ReleaseSempahore() *)
  394.   freeTwice    * = 01000009H; (* Freeing memory already freed *)
  395.   bogusExcpt   * = 8100000AH; (* illegal 68k exception taken (obs.) *)
  396.   ioUsedTwice  * = 0100000BH; (* Attempt to reuse active IORequest *)
  397.   memoryInsane * = 0100000CH; (* Sanity check on memory list failed
  398.                                       during availmem(memfLARGEST) *)
  399.   ioAfterClose* = 0100000DH; (* IO attempted on closed IORequest *)
  400.   stackProbe  * = 0100000EH; (* Stack appears to extend out of range *)
  401.   badFreeAddr * = 0100000FH; (* Memory header not located. [ Usually an
  402.                                 invalid address passed to FreeMem() ] *)
  403.   badSemaphore* = 01000010H; (* An attempt was made to use the old
  404.                                 message semaphores. *)
  405.  
  406. (* ------ graphics.library *)
  407.   anGraphicsLib * = 02000000H;
  408.   gfxNoMem      * = 82010000H;      (* graphics out of memory *)
  409.   gfxNoMemMspc  * = 82010001H;      (* MonitorSpec alloc, no memory *)
  410.   longFrame     * = 82010006H;      (* long frame, no memory *)
  411.   shortFrame    * = 82010007H;      (* short frame, no memory *)
  412.   textTmpRas    * = 02010009H;      (* text, no memory for TmpRas *)
  413.   bltBitMap     * = 8201000AH;      (* BltBitMap, no memory *)
  414.   regionMemory  * = 8201000BH;      (* regions, memory not available *)
  415.   makeVPort     * = 82010030H;      (* MakeVPort, no memory *)
  416.   gfxNewError   * = 0200000CH;
  417.   gfxFreeError  * = 0200000DH;
  418.  
  419.   gfxNoLCM      * = 82011234H;      (* emergency memory not available *)
  420.  
  421.   obsoleteFont  * = 02000401H;      (* unsupported font description used *)
  422.  
  423. (* ------ layers.library *)
  424.   anLayersLib   * = 03000000H;
  425.   layersNoMem   * = 83010000H;      (* layers out of memory *)
  426.  
  427. (* ------ intuition.library *)
  428.   anIntuition  * = 04000000H;
  429.   gadgetType   * = 84000001H;      (* unknown gadget type *)
  430.   badGadget    * = 04000001H;      (* Recovery form of GadgetType *)
  431.   createPort   * = 84010002H;      (* create port, no memory *)
  432.   itemAlloc    * = 04010003H;      (* item plane alloc, no memory *)
  433.   subAlloc     * = 04010004H;      (* sub alloc, no memory *)
  434.   planeAlloc   * = 84010005H;      (* plane alloc, no memory *)
  435.   itemBoxTop   * = 84000006H;      (* item box top < RelZero *)
  436.   openScreen   * = 84010007H;      (* open screen, no memory *)
  437.   openScrnRast * = 84010008H;      (* open screen, raster alloc, no memory *)
  438.   sysScrnType  * = 84000009H;      (* open sys screen, unknown type *)
  439.   addSWGadget  * = 8401000AH;      (* add SW gadgets, no memory *)
  440.   openWindow   * = 8401000BH;      (* open window, no memory *)
  441.   badState     * = 8400000CH;      (* Bad State Return entering Intuition *)
  442.   badMessage   * = 8400000DH;      (* Bad Message received by IDCMP *)
  443.   weirdEcho    * = 8400000EH;      (* Weird echo causing incomprehension *)
  444.   noConsole    * = 8400000FH;      (* couldn't open the Console Device *)
  445.   noISem       * = 004000010H;     (* Intuition skipped obtaining a sem *)
  446.   iSemOrder    * = 004000011H;     (* Intuition obtained a sem in bad order *)
  447.  
  448. (* ------ math.library *)
  449.   anMathLib     * = 05000000H;
  450.  
  451. (* ------ dos.library *)
  452.   anDosLib     * = 07000000H;
  453.   startMem     * = 07010001H; (* no memory at startup *)
  454.   endTask      * = 07000002H; (* EndTask didn't *)
  455.   qPktFail     * = 07000003H; (* Qpkt failure *)
  456.   asyncPkt     * = 07000004H; (* Unexpected packet received *)
  457.   freeVec      * = 07000005H; (* Freevec failed *)
  458.   diskBlkSeq   * = 07000006H; (* Disk block sequence error *)
  459.   bitMap       * = 07000007H; (* Bitmap corrupt *)
  460.   keyFree      * = 07000008H; (* Key already free *)
  461.   badChkSum    * = 07000009H; (* Invalid checksum *)
  462.   diskError    * = 0700000AH; (* Disk Error *)
  463.   keyRange     * = 0700000BH; (* Key out of range *)
  464.   badOverlay   * = 0700000CH; (* Bad overlay *)
  465.   badInitFunc  * = 0700000DH; (* Invalid init packet for cli/shell *)
  466.   fileReclosed * = 0700000EH; (* A filehandle was closed more than once *)
  467.  
  468. (* ------ ramlib.library *)
  469.   anRAMLib    * = 08000000H;
  470.   badSegList  * = 08000001H;      (* no overlays in library seglists *)
  471.  
  472. (* ------ icon.library *)
  473.   anIconLib     * = 09000000H;
  474.  
  475. (* ------ expansion.library *)
  476.   anExpansionLib   * = 0A000000H;
  477.   badExpansionFree * = 0A000001H; (* freeed free region *)
  478.  
  479. (* ------ diskfont.library *)
  480.   anDiskfontLib * = 0B000000H;
  481.  
  482. (* ------ audio.device *)
  483.   anAudioDev    * = 10000000H;
  484.  
  485. (* ------ console.device *)
  486.   anConsoleDev  * = 11000000H;
  487.   noWindow      * = 11000001H;      (* Console can't open initial window *)
  488.  
  489. (* ------ gameport.device *)
  490.   anGamePortDev * = 12000000H;
  491.  
  492. (* ------ keyboard.device *)
  493.   anKeyboardDev * = 13000000H;
  494.  
  495. (* ------ trackdisk.device *)
  496.   anTrackDiskDev * = 14000000H;
  497.   tdCalibSeek    * = 14000001H;      (* calibrate: seek error *)
  498.   tdDelay        * = 14000002H;      (* delay: error on timer wait *)
  499.  
  500. (* ------ timer.device *)
  501.   anTimerDev    * = 15000000H;
  502.   tmBadReq      * = 15000001H; (* bad request *)
  503.   tmBadSupply   * = 15000002H; (* power supply -- no 50/60Hz ticks *)
  504.  
  505. (* ------ cia.resource *)
  506.   anCIARsrc     * = 20000000H;
  507.  
  508. (* ------ disk.resource *)
  509.   anDiskRsrc    * = 21000000H;
  510.   drHasDisk     * = 21000001H;      (* get unit: already has disk *)
  511.   drIntNoAct    * = 21000002H;      (* interrupt: no active unit *)
  512.  
  513. (* ------ misc.resource *)
  514.   anMiscRsrc    * = 22000000H;
  515.  
  516. (* ------ bootstrap *)
  517.   anBootStrap   * = 30000000H;
  518.   bootError     * = 30000001H;      (* boot code returned an error *)
  519.  
  520. (* ------ Workbench *)
  521.   anWorkbench                   * = 31000000H;
  522.   noFonts                       * = 0B1000001H;
  523.   wbBadStartupMsg1              * = 31000001H;
  524.   wbBadStartupMsg2              * = 31000002H;
  525.   wbBadIOMsg                    * = 31000003H;
  526.   wbReLayoutToolMenu            * = 0B1010009H;
  527.  
  528.   (* The following are in the V37 includes, but not the V40 *)
  529.  
  530.   wbInitPotionAllocDrawer     * = 0B1010004H;
  531.   wbCreateWBMenusCreateMenus1 * = 0B1010005H;
  532.   wbCreateWBMenusCreateMenus2 * = 0B1010006H;
  533.   wbLayoutWBMenusLayoutMenus  * = 0B1010007H;
  534.   wbAddToolMenuItem           * = 0B1010008H;
  535.   wbinitTimer                 * = 0B101000AH;
  536.   wbInitLayerDemon            * = 0B101000BH;
  537.   wbinitWbGels                * = 0B101000CH;
  538.   wbInitScreenAndWindows1     * = 0B101000DH;
  539.   wbInitScreenAndWindows2     * = 0B101000EH;
  540.   wbInitScreenAndWindows3     * = 0B101000FH;
  541.   wbMAlloc                    * = 0B1010010H;
  542.  
  543. (* ------ DiskCopy *)
  544.   anDiskCopy    * = 32000000H;
  545.  
  546. (* ------ toolkit for Intuition *)
  547.   anGadTools    * = 33000000H;
  548.  
  549. (* ------ System utility library *)
  550.   anUtilityLib  * = 34000000H;
  551.  
  552. (* ------ For use by any application that needs it *)
  553.   anUnknown     * = 35000000H;
  554.  
  555. (*
  556. **      $VER: errors.h 39.0 (15.10.91)
  557. **
  558. **      Standard Device IO Errors (returned in ioError)
  559. *)
  560.  
  561.   openFail  * = -1; (* device/unit failed to open *)
  562.   aborted   * = -2; (* request terminated early [after AbortIO()] *)
  563.   noCmd     * = -3; (* command not supported by device *)
  564.   badLength * = -4; (* not a valid length (usually ioLENGTH) *)
  565.   badAddress* = -5; (* invalid address (misaligned or bad range) *)
  566.   unitBusy  * = -6; (* device opens ok, but requested unit is busy *)
  567.   selfTest  * = -7; (* hardware failed self-test *)
  568.  
  569.  
  570. (*
  571. **      $VER: resident.h 39.0 (15.10.91)
  572. **
  573. **      Resident/ROMTag stuff.  Used to identify and initialize code modules.
  574. *)
  575.  
  576.  
  577. TYPE
  578.  
  579.   Resident* = RECORD
  580.     matchWord* : UWORD;          (* word to match on (ILLEGAL)       *)
  581.     matchTag*  : ResidentPtr;    (* pointer to the above             *)
  582.     endSkip*   : APTR;           (* address to continue scan         *)
  583.     flags*     : s.SET8;           (* various tag flags                *)
  584.     version*   : SHORTINT;          (* release version number           *)
  585.     type*      : SHORTINT;          (* type of module (ntXXXXXX)        *)
  586.     pri*       : SHORTINT;       (* initialization priority          *)
  587.     name*      : LSTRPTR;         (* pointer to node name             *)
  588.     idString*  : LSTRPTR;         (* pointer to identification string *)
  589.     init*      : APTR;           (* pointer to init code             *)
  590.   END; (* Resident *)
  591.  
  592. CONST
  593.  
  594.   matchWord  * = 4AFCH;  (* The 68000 "ILLEGAL" instruction *)
  595.  
  596.   autoInit   * = 7;  (* Resident.init points to data structure *)
  597.   afterDos   * = 2;
  598.   singleTask * = 1;
  599.   coldStart  * = 0;
  600.  
  601.   never      * = {};
  602.  
  603. (*
  604. **      $VER: memory.h 39.3 (21.5.92)
  605. **
  606. **      Definitions and structures used by the memory allocation system
  607. *)
  608.  
  609. TYPE
  610.  
  611. (****** MemChunk ****************************************************)
  612.  
  613.   MemChunk* = RECORD
  614.     next*  : MemChunkPtr;  (* pointer to next chunk *)
  615.     bytes* : ULONG;        (* chunk byte size       *)
  616.   END; (* MemChunk *)
  617.  
  618.  
  619. (****** MemHeader ***************************************************)
  620.  
  621.   MemHeader* = RECORD (NodeBase)
  622.     node*       : Node;
  623.     attributes* : s.SET16;        (* characteristics of this region *)
  624.     first*      : MemChunkPtr;  (* first free region              *)
  625.     lower*      : APTR;         (* lower memory bound             *)
  626.     upper*      : APTR;         (* upper memory bound+1           *)
  627.     free*       : ULONG;        (* total number of free bytes     *)
  628.   END; (* MemHeader *)
  629.  
  630.  
  631. (****** MemEntry ****************************************************)
  632.  
  633.   MemEntry* = RECORD
  634.     addr *   : APTR;           (* the address of this memory region *)
  635.  (** reqs *   : s.SET32;        (* the AllocMem requirements         *)
  636.   *
  637.   * This occupies the same space as addr (a C union).  Access via:
  638.   *   SYS.VAL (s.SET32, MemEntry.addr)
  639.   *)
  640.     length * : ULONG;          (* the length of this memory region  *)
  641.   END; (* MemEntry *)
  642.  
  643. (****** MemList *****************************************************)
  644.  
  645. (* Note: SIZE (MemList) includes the size of the first MemEntry!
  646.    No it doesn't !!  This is *Oberon*, not C !! *)
  647.  
  648.   MemList* = RECORD (NodeBase)
  649.     node       * : Node;
  650.     numEntries * : UWORD;             (* number of entries in this struct *)
  651.   (*me         * : ARRAY OF MemEntry; (* the first entry      *)*)
  652.   END; (* MemList *)
  653.  
  654. CONST
  655.  
  656. (* ----- Memory Requirement Types ---------------------------*)
  657. (* ----- See the AllocMem() documentation for details--------*)
  658.  
  659.   any         * = {};   (* Any type of memory will do *)
  660.   public      * = 0;
  661.   chip        * = 1;
  662.   fast        * = 2;
  663.   local       * = 8;    (* Memory that does not go away at RESET *)
  664.   mem24BitDMA * = 9;    (* DMAable memory within 24 bits of address *)
  665.   kick        * = 10;   (* Memory that can be used for KickTags *)
  666.  
  667.   memClear    * = 16;   (* AllocMem: NULL out area before return *)
  668.   largest     * = 17;   (* AvailMem: return the largest chunk size *)
  669.   reverse     * = 18;   (* AllocMem: allocate from the top down *)
  670.   total       * = 19;   (* AvailMem: return total size of memory *)
  671.  
  672.   noExpunge* = 31;   (*AllocMem: Do not cause expunge on failure *)
  673.  
  674. (* ----- Current alignment rules for memory blocks (may increase) -----*)
  675.   blockSize  * = 8;
  676.   blockMask  * = (blockSize-1);
  677.  
  678. TYPE
  679.  
  680. (****** MemHandlerData **********************************************)
  681. (* Note:  This structure is *READ ONLY* and only EXEC can create it!*)
  682.   MemHandlerData * = RECORD
  683.     requestSize  - :  ULONG;  (* Requested allocation size *)
  684.     requestFlags - :  s.SET32;(* Requested allocation flags *)
  685.     flags        - :  s.SET32;(* Flags (see below) *)
  686.   END;
  687.  
  688. CONST
  689.  
  690.   recycle * = 0;      (* 0==First time, 1==recycle *)
  691.  
  692. (****** Low Memory handler return values ***************************)
  693.   didNothing * =  0;  (* Nothing we could do... *)
  694.   allDone    * = -1;  (* We did all we could do *)
  695.   tryAgain   * =  1;  (* We did some, try the allocation again *)
  696.  
  697. (*
  698. **      $VER: tasks.h 39.3 (18.9.92)
  699. **
  700. **      Task Control Block, Singals, and Task flags.
  701. *)
  702.  
  703. TYPE
  704.  
  705.   TaskBase *= RECORD (NodeBase) END;
  706.   TaskBasePtr *= POINTER TO TaskBase;
  707.  
  708. (* Please use Exec functions to modify task structure fields, where available.
  709.  *)
  710.   Task * = RECORD (TaskBase)
  711.     node*       : Node;
  712.     flags*      : s.SET8;
  713.     state*      : s.SET8;
  714.     idNestCnt*  : SHORTINT;   (* intr disabled nesting*)
  715.     tdNestCnt*  : SHORTINT;   (* task disabled nesting*)
  716.     sigAlloc*   : s.SET32;    (* sigs allocated *)
  717.     sigWait*    : s.SET32;    (* sigs we are waiting for *)
  718.     sigRecvd*   : s.SET32;    (* sigs we have received *)
  719.     sigExcept*  : s.SET32;    (* sigs we will take excepts for *)
  720.     trapAlloc*  : s.SET16;      (* traps allocated *)
  721.     trapAble*   : s.SET16;      (* traps enabled *)
  722.     exceptData* : APTR;       (* points to except data *)
  723.     exceptCode* : PROC;       (* points to except code *)
  724.     trapData*   : APTR;       (* points to trap code *)
  725.     trapCode*   : PROC;       (* points to trap data *)
  726.     spReg*      : APTR;       (* stack pointer        *)
  727.     spLower*    : APTR;       (* stack lower bound    *)
  728.     spUpper*    : APTR;       (* stack upper bound + 2*)
  729.     switch*     : PROC;       (* task losing CPU    *)
  730.     launch*     : PROC;       (* task getting CPU  *)
  731.     memEntry*   : List;       (* Allocated memory. Freed by RemTask() *)
  732.     userData*   : APTR;       (* For use by the task; no restrictions! *)
  733.   END; (* Task *)
  734.  
  735. (*
  736.  * Stack swap structure as passed to StackSwap()
  737.  *)
  738.   StackSwapStruct* = RECORD
  739.     lower*   : APTR;    (* Lowest byte of stack *)
  740.     upper*   : ULONG;   (* Upper end of stack (size + Lowest) *)
  741.     pointer* : APTR;    (* Stack pointer at switch point *)
  742.   END; (* StackSwapStruct *)
  743.  
  744. CONST
  745.  
  746. (* ----- Flag Bits ------------------------------------------*)
  747.   procTime    * = 0;
  748.   eTask       * = 3;
  749.   stackChk    * = 4;
  750.   exception   * = 5;
  751.   switch      * = 6;
  752.   launch      * = 7;
  753.  
  754. (* ----- Task States ----------------------------------------*)
  755.   inval       * = 0;
  756.   added       * = 1;
  757.   run         * = 2;
  758.   ready       * = 3;
  759.   wait        * = 4;
  760.   except      * = 5;
  761.   removed     * = 6;
  762.  
  763. (* ----- Predefined Signals -------------------------------------*)
  764.   sigAbort     * = 0;
  765.   sigChild     * = 1;
  766.   sigBlit      * = 4;       (* Note: same as SINGLE *)
  767.   sigSingle    * = 4;       (* Note: same as BLIT *)
  768.   sigIntuition * = 5;
  769.   sigNet       * = 7;
  770.   sigDos       * = 8;
  771.  
  772. (*
  773. **      $VER: ports.h 39.0 (15.10.91)
  774. **
  775. **      Message ports and Messages.
  776. *)
  777.  
  778. TYPE
  779.  
  780.   MsgPortBase *= RECORD (NodeBase) END;
  781.   MsgPortBasePtr *= POINTER TO MsgPortBase;
  782.  
  783. (****** MsgPort *****************************************************)
  784.  
  785.   MsgPort * = RECORD (MsgPortBase)
  786.     node*    : Node;
  787.     flags*   : SHORTINT;
  788.     sigBit*  : SHORTINT;(* signal bit number    *)
  789.     sigTask* : TaskPtr; (* object to be signalled *)
  790.     msgList* : List;    (* message linked list  *)
  791.   END; (* MsgPort *)
  792.  
  793.   MsgPortSoftInt* = RECORD (MsgPortBase)
  794.     node*    : Node;
  795.     flags*   : SHORTINT;
  796.     sigBit*  : SHORTINT;     (* signal bit number    *)
  797.     softInt* : InterruptPtr; (* object to be signalled *)
  798.     msgList* : List;         (* message linked list  *)
  799.   END; (* MsgPortSoftInt *)
  800.  
  801. CONST
  802.  
  803. (* MsgPort.flags: Port arrival actions (PutMsg) *)
  804.   signal    * = 0;     (* Signal task in mpSigTask *)
  805.   softint   * = 1;     (* Signal SoftInt in mpsoftint/mpSigTask *)
  806.   ignore    * = 2;     (* Ignore arrival *)
  807.  
  808.  
  809. TYPE
  810.  
  811.   MessageBase *= RECORD (NodeBase) END;
  812.   MessageBasePtr *= POINTER TO MessageBase;
  813.  
  814. (****** Message *****************************************************)
  815.  
  816.   Message * = RECORD (MessageBase)
  817.     node*      : Node;
  818.     replyPort* : MsgPortPtr;  (* message reply port *)
  819.     length*    : UWORD;       (* total message length, in bytes *)
  820.                               (* (include the size of the Message *)
  821.                               (* structure in the length) *)
  822.   END; (* Message *)
  823.  
  824. (*
  825. **      $VER: interrupts.h 39.1 (18.9.92)
  826. **
  827. **      Callback structures used by hardware & software interrupts
  828. *)
  829.  
  830. TYPE
  831.  
  832.   Interrupt * = RECORD (NodeBase)
  833.     node* : Node;
  834.     data* : APTR;                (* server data segment  *)
  835.     code* : PROC;                (* server code entry    *)
  836.   END; (* Interrupt *)
  837.  
  838.  
  839.   IntVector * = RECORD            (* For EXEC use ONLY! *)
  840.     data* : APTR;
  841.     code* : PROC;
  842.     node* : NodePtr;
  843.   END; (* IntVector *)
  844.  
  845.  
  846.   SoftIntList * = RECORD (CommonList)   (* For EXEC use ONLY! *)
  847.     list* : List;
  848.     pad*  : UWORD;
  849.   END; (* SoftIntList *)
  850.  
  851. CONST
  852.  
  853. (* this is a fake INT definition, used only for AddIntServer and the like *)
  854.   nmi * = 15;
  855.  
  856. (*
  857. **      $VER: semaphores.h 39.1 (7.2.92)
  858. **
  859. **      Definitions for locking functions.
  860. *)
  861.  
  862. TYPE
  863.  
  864. (****** SignalSemaphore *********************************************)
  865.  
  866. (* Private structure used by ObtainSemaphore() *)
  867.   SemaphoreRequest = RECORD (MinNodeBase)
  868.     link   - : MinNode;
  869.     waiter - : TaskPtr;
  870.   END; (* SemaphoreRequest *)
  871.  
  872. (* Signal Semaphore data structure *)
  873.   SignalSemaphoreBase *= RECORD (NodeBase) END;
  874.   SignalSemaphoreBasePtr *= POINTER TO SignalSemaphoreBase;
  875.  
  876.   SignalSemaphore * = RECORD (SignalSemaphoreBase)
  877.     link*         : Node;
  878.     nestCount*    : INTEGER;
  879.     waitQueue*    : MinList;
  880.     multipleLink- : SemaphoreRequest;
  881.     owner*        : TaskPtr;
  882.     queueCount*   : INTEGER;
  883.   END; (* SignalSemaphore *)
  884.  
  885. (****** Semaphore procure message (for use in V39 Procure/Vacate ****)
  886.   SemaphoreMessageBase *= RECORD (MessageBase) END;
  887.   SemaphoreMessageBasePtr *= POINTER TO SemaphoreMessageBase;
  888.  
  889.   SemaphoreMessage * = RECORD (SemaphoreMessageBase)
  890.     semaphore * :  SignalSemaphorePtr;
  891.   END;
  892.  
  893. CONST
  894.  
  895.   shared    * = 1;
  896.   exclusive * = 0;
  897.  
  898. TYPE
  899.  
  900.   MsgPortLockMsg * = RECORD (MsgPortBase)
  901.     node   * : Node;
  902.     flags  * : SHORTINT;
  903.     sigBit * : SHORTINT;     (* signal bit number    *)
  904.     lockMsg* : MessagePtr;   (* object to be signalled *) (* may be other type [hG] *)
  905.     msgList* : List;         (* message linked list  *)
  906.   END;
  907.  
  908. TYPE
  909.  
  910. (****** Semaphore (Old Procure/Vacate type, not reliable) ***********)
  911.  
  912.   Semaphore* = RECORD (MsgPortBase) (* Do not use these semaphores! *)
  913.     msgPort* : MsgPort;
  914.     bids*    : INTEGER;
  915.   END; (* Semaphore *)
  916.  
  917.  
  918. (*
  919. **      $VER: libraries.h 39.2 (10.4.92)
  920. **
  921. **      Definitions for use when creating or using Exec libraries
  922. *)
  923.  
  924.  
  925. CONST
  926.  
  927. (* ------ Special Constants ---------------------------------------*)
  928.   vectSize   * = 6;       (* Each library entry takes 6 bytes *)
  929.   reserved   * = 4;       (* Exec reserves the first 4 vectors *)
  930.   base       * = -vectSize;
  931.   userDef    * = base-reserved*vectSize;
  932.   nonStd     * = userDef;
  933.  
  934. (* ------ Standard Functions --------------------------------------*)
  935.   open       * = -6;
  936.   close      * = -12;
  937.   expunge    * = -18;
  938.   extFunc    * = -24;   (* for future expansion *)
  939.  
  940. TYPE
  941.  
  942. (* ------ Library Base Structure ----------------------------------*)
  943. (* Also used for Devices and some Resources *)
  944.   LibraryBase *= RECORD (NodeBase) END;
  945.   LibraryBasePtr *= POINTER TO LibraryBase;
  946.  
  947.   Library * = RECORD (LibraryBase)
  948.     node*     : Node;
  949.     flags*    : s.SET8;
  950.     pad*      : SHORTINT;
  951.     negSize*  : UWORD;          (* number of bytes before library *)
  952.     posSize*  : UWORD;          (* number of bytes after library *)
  953.     version*  : UWORD;          (* major *)
  954.     revision* : UWORD;          (* minor *)
  955.     idString* : LSTRPTR;        (* ASCII identification *)
  956.     sum*      : ULONG;          (* the checksum itself *)
  957.     openCnt*  : UWORD;          (* number of current opens *)
  958.   END; (* Library *)      (* Warning: size is not a longword multiple! *)
  959.  
  960. CONST
  961.  
  962. (* Flags bit definitions (all others are system reserved) *)
  963.   summing   * = 0;      (* we are currently checksumming *)
  964.   changed   * = 1;      (* we have just changed the lib *)
  965.   sumUsed   * = 2;      (* set if we should bother to sum *)
  966.   delExp    * = 3;      (* delayed expunge *)
  967.  
  968.  
  969. (*
  970. **      $VER: io.h 39.0 (15.10.91)
  971. **
  972. **      Message structures used for device communication
  973. *)
  974.  
  975.  
  976. TYPE
  977.  
  978.   IORequestBase *= RECORD (MessageBase) END;
  979.   IORequestBasePtr *= POINTER TO IORequestBase;
  980.  
  981.   IORequest * = RECORD (IORequestBase)
  982.     message* : Message;
  983.     device*  : DevicePtr;  (* device node pointer  *)
  984.     unit*    : UnitPtr;    (* unit (driver private)*)
  985.     command* : UWORD;      (* device command *)
  986.     flags*   : s.SET8;
  987.     error*   : SHORTINT;   (* error or warning num *)
  988.   END; (* IORequest *)
  989.  
  990.   IOStdReq * = RECORD (IORequestBase)
  991.     message* : Message;
  992.     device*  : DevicePtr;  (* device node pointer  *)
  993.     unit*    : UnitPtr;    (* unit (driver private)*)
  994.     command* : UWORD;      (* device command *)
  995.     flags*   : s.SET8;
  996.     error*   : SHORTINT;   (* error or warning num *)
  997.     actual*  : ULONG;      (* actual number of bytes transferred *)
  998.     length*  : ULONG;      (* requested number bytes transferred*)
  999.     data*    : APTR;       (* points to data area *)
  1000.     offset*  : ULONG;      (* offset for block structured devices *)
  1001.   END; (* IOStdReq *)
  1002.  
  1003. CONST
  1004.  
  1005. (* library vector offsets for device reserved vectors *)
  1006.   beginIO    * = -30;
  1007.   abortIO    * = -36;
  1008.  
  1009. (* ioFlags defined bits *)
  1010.   quick      * = 0;
  1011.  
  1012.  
  1013.   invalid    * = 0;
  1014.   reset      * = 1;
  1015.   read       * = 2;
  1016.   write      * = 3;
  1017.   update     * = 4;
  1018.   clear      * = 5;
  1019.   stop       * = 6;
  1020.   start      * = 7;
  1021.   flush      * = 8;
  1022.  
  1023.   nonstd     * = 9;
  1024.  
  1025. (*
  1026. **      $VER: devices.h 39.0 (15.10.91)
  1027. **
  1028. **      Include file for use by Exec device drivers
  1029. *)
  1030.  
  1031. TYPE
  1032.  
  1033. (****** Device ******************************************************)
  1034.  
  1035.   DeviceBase *= RECORD (LibraryBase) END;
  1036.   DeviceBasePtr *= POINTER TO DeviceBase;
  1037.  
  1038.   Device * = RECORD (DeviceBase) library * : Library END;
  1039.  
  1040.  
  1041. (****** Unit ********************************************************)
  1042.  
  1043.   UnitBase *= RECORD (MsgPortBase) END;
  1044.   UnitBasePtr *= POINTER TO UnitBase;
  1045.  
  1046.   Unit * = RECORD (UnitBase)
  1047.     msgPort* : MsgPort;  (* queue for unprocessed messages *)
  1048.                          (* instance of msgport is recommended *)
  1049.     flags*   : s.SET8;
  1050.     pad*     : BYTE;
  1051.     openCnt* : UWORD;    (* number of active opens *)
  1052.   END; (* Unit *)
  1053.  
  1054.  
  1055. CONST
  1056.  
  1057.   active   * = 0;
  1058.   inTask   * = 1;
  1059.  
  1060.  
  1061. (*
  1062. **      $VER: execbase.h 39.6 (18.1.93)
  1063. **
  1064. **      Definition of the exec.library base structure.
  1065. *)
  1066.  
  1067. TYPE
  1068.  
  1069. (* Definition of the Exec library base structure (pointed to by location 4).
  1070. ** Most fields are not to be viewed or modified by user programs.  Use
  1071. ** extreme caution.
  1072. *)
  1073.   ExecBase* = RECORD (LibraryBase)
  1074.     libNode*         : Library; (* Standard library node *)
  1075.  
  1076. (******** Static System Variables ********)
  1077.  
  1078.     softVer*         : UWORD;   (* kickstart release number (obs.) *)
  1079.     lowMemChkSum*    : INTEGER; (* checksum of 68000 trap vectors *)
  1080.     chkBase*         : ULONG;   (* system base pointer complement *)
  1081.     coldCapture*     : APTR;    (* coldstart soft capture vector *)
  1082.     coolCapture*     : APTR;    (* coolstart soft capture vector *)
  1083.     warmCapture*     : APTR;    (* warmstart soft capture vector *)
  1084.     sysStkUpper*     : APTR;    (* system stack base   (upper bound) *)
  1085.     sysStkLower*     : APTR;    (* top of system stack (lower bound) *)
  1086.     maxLocMem*       : APTR;    (* top of chip memory *)
  1087.     debugEntry*      : APTR;    (* global debugger entry point *)
  1088.     debugData*       : APTR;    (* global debugger data segment *)
  1089.     alertData*       : APTR;    (* alert data segment *)
  1090.     maxExtMem*       : APTR;    (* top of extended mem, or null if none *)
  1091.  
  1092.     chkSum*          : UWORD; (* for all of the above (minus 2) *)
  1093.  
  1094. (****** Interrupt Related ***************************************)
  1095.  
  1096.     intVects         : ARRAY 16 OF IntVector;
  1097.  
  1098. (****** Dynamic System Variables *************************************)
  1099.  
  1100.     thisTask*        : TaskPtr; (* pointer to current task (readable) *)
  1101.  
  1102.     idleCount*       : ULONG;   (* idle counter *)
  1103.     dispCount*       : ULONG;   (* dispatch counter *)
  1104.     quantum*         : UWORD;   (* time slice quantum *)
  1105.     elapsed*         : UWORD;   (* current quantum ticks *)
  1106.     sysFlags*        : s.SET16; (* misc internal system flags *)
  1107.     idNestCnt*       : SHORTINT;    (* interrupt disable nesting count *)
  1108.     tdNestCnt*       : SHORTINT;    (* task disable nesting count *)
  1109.  
  1110.     attnFlags*       : s.SET16; (* special attention flags (readable) *)
  1111.  
  1112.     attnResched*     : UWORD;   (* rescheduling attention *)
  1113.     resModules*      : APTR;    (* resident module array pointer *)
  1114.     taskTrapCode*    : PROC;
  1115.     taskExceptCode*  : PROC;
  1116.     taskExitCode*    : PROC;
  1117.     taskSigAlloc*    : s.SET32;
  1118.     taskTrapAlloc*   : s.SET16;
  1119.  
  1120.  
  1121. (****** System Lists (private!) ********************************)
  1122.  
  1123.     memList-         : List;
  1124.     resourceList-    : List;
  1125.     deviceList-      : List;
  1126.     intrList-        : List;
  1127.     libList-         : List;
  1128.     portList-        : List;
  1129.     taskReady-       : List;
  1130.     taskWait-        : List;
  1131.  
  1132.     softInts         : ARRAY 5 OF SoftIntList;
  1133.  
  1134. (****** Other Globals *******************************************)
  1135.  
  1136.     lastAlert-       : ARRAY 4 OF LONGINT;
  1137.  
  1138.     (* these next two variables are provided to allow
  1139.     ** system developers to have a rough idea of the
  1140.     ** period of two externally controlled signals --
  1141.     ** the time between vertical blank interrupts and the
  1142.     ** external line rate (which is counted by CIA A's
  1143.     ** "time of day" clock).  In general these values
  1144.     ** will be 50 or 60, and may or may not track each
  1145.     ** other.  These values replace the obsolete afbPAL
  1146.     ** and afb50HZ flags.
  1147.     *)
  1148.     vblankFrequency-      : SHORTINT;   (* (readable) *)
  1149.     powerSupplyFrequency- : SHORTINT;   (* (readable) *)
  1150.  
  1151.     semaphoreList-   : List;
  1152.  
  1153.     (* these next two are to be able to kickstart into user ram.
  1154.     ** KickMemPtr holds a singly linked list of MemLists which
  1155.     ** will be removed from the memory list via AllocAbs.  If
  1156.     ** all the AllocAbs's succeeded, then the KickTagPtr will
  1157.     ** be added to the rom tag list.
  1158.     *)
  1159.     kickMemPtr*      : APTR;   (* ptr to queue of mem lists *)
  1160.     kickTagPtr*      : APTR;   (* ptr to rom tag queue *)
  1161.     kickCheckSum*    : APTR;   (* checksum for mem and tags *)
  1162.  
  1163. (****** V36 Exec additions start here **************************************)
  1164.  
  1165.     pad0             : UWORD;
  1166.     launchPoint      : ULONG;  (* Private to Launch/Switch *)
  1167.     ramLibPrivate    : APTR;
  1168.     (* The next ULONG contains the system "E" clock frequency,
  1169.     ** expressed in Hertz.  The E clock is used as a timebase for
  1170.     ** the Amiga's 8520 I/O chips. (E is connected to "02").
  1171.     ** Typical values are 715909 for NTSC, or 709379 for PAL.
  1172.     *)
  1173.     eClockFrequency- : ULONG;     (* (readable) *)
  1174.     cacheControl     : APTR;      (* Private to CacheControl calls *)
  1175.     taskID*          : ULONG;     (* Next available task ID *)
  1176.  
  1177.     reserved1*       : ARRAY 5 OF ULONG;
  1178.  
  1179.     mmuLock          : APTR;      (* private *)
  1180.  
  1181.     reserved2*       : ARRAY 3 OF ULONG;
  1182.  
  1183. (****** V39 Exec additions start here **************************************)
  1184.  
  1185.         (* The following list and data element are used
  1186.          * for V39 exec's low memory handler...
  1187.          *)
  1188.     memHandlers*     :  MinList;  (* The handler list *)
  1189.     memHandler       :  APTR;     (* Private! handler pointer *)
  1190.   END; (* ExecBase *)
  1191.  
  1192.  
  1193. CONST
  1194.  
  1195. (****** Bit defines for AttnFlags (see above) ******************************)
  1196.  
  1197. (*  Processors and Co-processors: *)
  1198.   m68010      * = 0;       (* also set for 68020 *)
  1199.   m68020      * = 1;       (* also set for 68030 *)
  1200.   m68030      * = 2;       (* also set for 68040 *)
  1201.   m68040      * = 3;
  1202.   m68881      * = 4;       (* also set for 68882 *)
  1203.   m68882      * = 5;
  1204.   mFPU40      * = 6;       (* Set if 68040 FPU *)
  1205. (*
  1206.  * The mFPU40 bit is set when a working 68040 FPU
  1207.  * is in the system.  If this bit is set and both the
  1208.  * m68881 and m68882 bits are not set, then the 68040
  1209.  * math emulation code has not been loaded and only 68040
  1210.  * FPU instructions are available.  This bit is valid *ONLY*
  1211.  * if the m68040 bit is set.
  1212.  *)
  1213.  
  1214. (****** Selected flag definitions for Cache manipulation calls **********)
  1215.  
  1216.   enableI      * = 0;  (* Enable instruction cache *)
  1217.   freezeI      * = 1;  (* Freeze instruction cache *)
  1218.   clearI       * = 3;  (* Clear instruction cache  *)
  1219.   ibe          * = 4;  (* Instruction burst enable *)
  1220.   enableD      * = 8;  (* 68030 Enable data cache  *)
  1221.   freezeD      * = 9;  (* 68030 Freeze data cache  *)
  1222.   clearD       * = 11; (* 68030 Clear data cache   *)
  1223.   dbe          * = 12; (* 68030 Data burst enable *)
  1224.   writeAllocate* = 13; (* 68030 Write-Allocate mode
  1225.                           (must always be set!)    *)
  1226.   enableE      * = 30; (* Master enable for external caches *)
  1227.                        (* External caches should track the *)
  1228.                        (* state of the internal caches *)
  1229.                        (* such that they do not cache anything *)
  1230.                        (* that the internal cache turned off *)
  1231.                        (* for. *)
  1232.   copyBack     * = 31; (* Master enable for copyback caches *)
  1233.  
  1234.   dmaContinue      * = 1;  (* Continuation flag for CachePreDMA *)
  1235.   dmaNoModify      * = 2;  (* Set if DMA does not update memory *)
  1236.   dmaReadFromRAM   * = 3;  (* Set if DMA goes *FROM* RAM to device *)
  1237.  
  1238. (**-- Library base pointer ---------------------------------------------*)
  1239.  
  1240. CONST
  1241.  
  1242.   absExecBase = 4;
  1243.  
  1244. VAR
  1245.  
  1246.   exec*, SysBase* : ExecBasePtr;
  1247.  
  1248.  
  1249. (**-- Library functions ------------------------------------------------*)
  1250.  
  1251. (* ------misc --------------------------------------------------------- *)
  1252.  
  1253. PROCEDURE Supervisor* [SysBase,-30]
  1254.   ( userFunction [13] : PROC )
  1255.   : APTR;
  1256.  
  1257. (* ------special patchable hooks to internal exec activity ------------ *)
  1258.  
  1259. (* ------module creation ---------------------------------------------- *)
  1260.  
  1261. PROCEDURE InitCode* [SysBase,-72]
  1262.   ( startClass [0] : s.SET8;
  1263.     version    [1] : ULONG );
  1264. PROCEDURE InitStruct* [SysBase,-78]
  1265.   ( initTable [9] : APTR;
  1266.     memory   [10] : APTR;
  1267.     size      [0] : ULONG );
  1268. PROCEDURE MakeLibrary* [SysBase,-84]
  1269.   ( funcInit   [8] : APTR;
  1270.     structInit [9] : APTR;
  1271.     libInit   [10] : PROC;
  1272.     dataSize   [0] : ULONG;
  1273.     segList    [1] : BPTR )
  1274.   : LibraryPtr;
  1275. PROCEDURE MakeFunctions* [SysBase,-90]
  1276.   ( target        [8] : APTR;
  1277.     functionArray [9] : APTR;
  1278.     funcDispBase [10] : APTR );
  1279. PROCEDURE FindResident* [SysBase,-96]
  1280.   ( name [9] : ARRAY OF CHAR )
  1281.   : ResidentPtr;
  1282. PROCEDURE InitResident* [SysBase,-102]
  1283.   ( resident [9] : ResidentPtr;
  1284.     segList  [1] : BPTR );
  1285.  
  1286. (* ------diagnostics -------------------------------------------------- *)
  1287.  
  1288. PROCEDURE Alert* [SysBase,-108]
  1289.   ( alertNum [7] : ULONG );
  1290. PROCEDURE Debug* [SysBase,-114]
  1291.   ( flags [0] : s.SET32 );
  1292.  
  1293. (* ------interrupts --------------------------------------------------- *)
  1294.  
  1295. PROCEDURE Disable* [SysBase,-120] ();
  1296. PROCEDURE Enable* [SysBase,-126] ();
  1297. PROCEDURE Forbid* [SysBase,-132] ();
  1298. PROCEDURE Permit* [SysBase,-138] ();
  1299. PROCEDURE SetSR* [SysBase,-144]
  1300.   ( newSR [0] : s.SET16;
  1301.     mask  [1] : s.SET16 )
  1302.   : s.SET16;
  1303. PROCEDURE SuperState* [SysBase,-150] ();
  1304. PROCEDURE UserState* [SysBase,-156]
  1305.   ( sysStack [0] : APTR );
  1306. PROCEDURE SetIntVector* [SysBase,-162]
  1307.   ( intNumber [0] : ULONG;
  1308.     interrupt [9] : InterruptPtr )
  1309.   : InterruptPtr;
  1310. PROCEDURE AddIntServer* [SysBase,-168]
  1311.   ( intNumber [0] : ULONG;
  1312.     interrupt [9] : InterruptPtr );
  1313. PROCEDURE RemIntServer* [SysBase,-174]
  1314.   ( intNumber [0] : ULONG;
  1315.     interrupt [9] : InterruptPtr );
  1316. PROCEDURE Cause* [SysBase,-180]
  1317.   ( interrupt [9] : InterruptPtr );
  1318.  
  1319. (* ------memory allocation -------------------------------------------- *)
  1320.  
  1321. PROCEDURE Allocate* [SysBase,-186]
  1322.   ( freeList [8] : MemHeaderPtr;
  1323.     byteSize [0] : ULONG )
  1324.   : APTR;
  1325. PROCEDURE Deallocate* [SysBase,-192]
  1326.   ( freeList    [8] : MemHeaderPtr;
  1327.     memoryBlock [9] : APTR;
  1328.     byteSize    [0] : ULONG );
  1329. PROCEDURE AllocMem* [SysBase,-198]
  1330.   ( byteSize     [0] : ULONG;
  1331.     requirements [1] : s.SET32 )
  1332.   : APTR;
  1333. PROCEDURE AllocAbs* [SysBase,-204]
  1334.   ( byteSize [0] : ULONG;
  1335.     location [1] : APTR )
  1336.   : APTR;
  1337. PROCEDURE FreeMem* [SysBase,-210]
  1338.   ( memoryBlock [9] : APTR;
  1339.     byteSize    [0] : ULONG );
  1340. PROCEDURE AvailMem* [SysBase,-216]
  1341.   ( requirements [1] : s.SET32 )
  1342.   : ULONG;
  1343. PROCEDURE AllocEntry* [SysBase,-222]
  1344.   ( entry [8] : APTR )
  1345.   : APTR;
  1346. PROCEDURE FreeEntry* [SysBase,-228]
  1347.   ( entry [8] : APTR );
  1348.  
  1349. (* ------lists -------------------------------------------------------- *)
  1350.  
  1351. PROCEDURE Insert* [SysBase,-234]
  1352.   ( VAR list [8] : CommonList;
  1353.     node     [9] : CommonNodePtr;
  1354.     pred    [10] : CommonNodePtr );
  1355. PROCEDURE AddHead* [SysBase,-240]
  1356.   ( VAR list [8] : CommonList;
  1357.     node     [9] : CommonNodePtr );
  1358. PROCEDURE AddTail* [SysBase,-246]
  1359.   ( VAR list [8] : CommonList;
  1360.     node     [9] : CommonNodePtr );
  1361. PROCEDURE Remove* [SysBase,-252]
  1362.   ( node [9] : CommonNodePtr );
  1363. PROCEDURE RemHead* [SysBase,-258]
  1364.   ( VAR list [8] : CommonList )
  1365.   : CommonNodePtr;
  1366. PROCEDURE RemTail* [SysBase,-264]
  1367.   ( VAR list [8] : CommonList )
  1368.   : CommonNodePtr;
  1369. PROCEDURE Enqueue* [SysBase,-270]
  1370.   ( VAR list [8] : CommonList;
  1371.     node     [9] : CommonNodePtr );
  1372. PROCEDURE FindName* [SysBase,-276]
  1373.   ( VAR list [8] : CommonList;
  1374.     name     [9] : ARRAY OF CHAR )
  1375.   : CommonNodePtr;
  1376.  
  1377. (* ------tasks -------------------------------------------------------- *)
  1378.  
  1379. PROCEDURE AddTask* [SysBase,-282]
  1380.   ( task     [9] : TaskBasePtr;
  1381.     initPC  [10] : PROC;
  1382.     finalPC [11] : APTR );
  1383. PROCEDURE RemTask* [SysBase,-288]
  1384.   ( task [9] : TaskBasePtr );
  1385. PROCEDURE FindTask* [SysBase,-294]
  1386.   ( name [9] : ARRAY OF CHAR )
  1387.   : TaskPtr;
  1388. PROCEDURE SetTaskPri* [SysBase,-300]
  1389.   ( task     [9] : TaskBasePtr;
  1390.     priority [0] : LONGINT )
  1391.   : SHORTINT;
  1392. PROCEDURE SetSignal* [SysBase,-306]
  1393.   ( newSignals [0] : s.SET32;
  1394.     signalSet  [1] : s.SET32 )
  1395.   : s.SET32;
  1396. PROCEDURE SetExcept* [SysBase,-312]
  1397.   ( newSignals [0] : s.SET32;
  1398.     signalSet  [1] : s.SET32 )
  1399.   : s.SET32;
  1400. PROCEDURE Wait* [SysBase,-318]
  1401.   ( signalSet [0] : s.SET32 )
  1402.   : s.SET32;
  1403. PROCEDURE Signal* [SysBase,-324]
  1404.   ( task      [9] : TaskBasePtr;
  1405.     signalSet [0] : s.SET32 );
  1406. PROCEDURE AllocSignal* [SysBase,-330]
  1407.   ( signalNum [0] : LONGINT )
  1408.   : SHORTINT;
  1409. PROCEDURE FreeSignal* [SysBase,-336]
  1410.   ( signalNum [0] : LONGINT );
  1411. PROCEDURE AllocTrap* [SysBase,-342]
  1412.   ( trapNum [0] : LONGINT )
  1413.   : SHORTINT;
  1414. PROCEDURE FreeTrap* [SysBase,-348]
  1415.   ( trapNum [0] : LONGINT );
  1416.  
  1417. (* ------messages ----------------------------------------------------- *)
  1418.  
  1419. PROCEDURE AddPort* [SysBase,-354]
  1420.   ( port [9] : MsgPortBasePtr );
  1421. PROCEDURE RemPort* [SysBase,-360]
  1422.   ( port [9] : MsgPortBasePtr );
  1423. PROCEDURE PutMsg* [SysBase,-366]
  1424.   ( port    [8] : MsgPortBasePtr;
  1425.     message [9] : MessageBasePtr );
  1426. PROCEDURE GetMsg* [SysBase,-372]
  1427.   ( port [8] : MsgPortBasePtr )
  1428.   : MessagePtr;
  1429. PROCEDURE ReplyMsg* [SysBase,-378]
  1430.   ( message [9] : MessageBasePtr );
  1431. PROCEDURE WaitPort* [SysBase,-384]
  1432.   ( port [8] : MsgPortBasePtr );
  1433. PROCEDURE FindPort* [SysBase,-390]
  1434.   ( name [9] : ARRAY OF CHAR )
  1435.   : MsgPortPtr;
  1436.  
  1437. (* ------libraries ---------------------------------------------------- *)
  1438.  
  1439. PROCEDURE AddLibrary* [SysBase,-396]
  1440.   ( library [9] : LibraryBasePtr );
  1441. PROCEDURE RemLibrary* [SysBase,-402]
  1442.   ( library [9] : LibraryBasePtr );
  1443. PROCEDURE OldOpenLibrary* [SysBase,-408]
  1444.   ( libName [9] : ARRAY OF CHAR )
  1445.   : LibraryPtr;
  1446. PROCEDURE CloseLibrary* [SysBase,-414]
  1447.   ( library [9] : LibraryBasePtr );
  1448. PROCEDURE SetFunction* [SysBase,-420]
  1449.   ( library     [9] : LibraryBasePtr;
  1450.     funcOffset  [8] : LONGINT;
  1451.     newFunction [0] : PROC )
  1452.   : PROC;
  1453. PROCEDURE SumLibrary* [SysBase,-426]
  1454.   ( library [9] : LibraryBasePtr );
  1455.  
  1456. (* ------devices ------------------------------------------------------ *)
  1457.  
  1458. PROCEDURE AddDevice* [SysBase,-432]
  1459.   ( device [9] : DeviceBasePtr );
  1460. PROCEDURE RemDevice* [SysBase,-438]
  1461.   ( device [9] : DeviceBasePtr );
  1462. PROCEDURE OpenDevice* [SysBase,-444]
  1463.   ( devName   [8] : ARRAY OF CHAR;
  1464.     unit      [0] : ULONG;
  1465.     ioRequest [9] : MessageBasePtr;
  1466.     flags     [1] : s.SET32 )
  1467.   : SHORTINT;
  1468. PROCEDURE CloseDevice* [SysBase,-450]
  1469.   ( ioRequest [9] : MessageBasePtr );
  1470. PROCEDURE DoIO* [SysBase,-456]
  1471.   ( ioRequest [9] : MessageBasePtr )
  1472.   : SHORTINT;
  1473. PROCEDURE OldDoIO* [SysBase,-456]
  1474.   ( ioRequest [9] : MessageBasePtr );
  1475. PROCEDURE SendIO* [SysBase,-462]
  1476.   ( ioRequest [9] : MessageBasePtr );
  1477. PROCEDURE CheckIO* [SysBase,-468]
  1478.   ( ioRequest [9] : MessageBasePtr )
  1479.   : IORequestPtr;
  1480. PROCEDURE WaitIO* [SysBase,-474]
  1481.   ( ioRequest [9] : MessageBasePtr )
  1482.   : SHORTINT;
  1483. PROCEDURE OldWaitIO* [SysBase,-474]
  1484.   ( ioRequest [9] : MessageBasePtr );
  1485. PROCEDURE AbortIO* [SysBase,-480]
  1486.   ( ioRequest [9] : MessageBasePtr );
  1487.  
  1488. (* ------resources ---------------------------------------------------- *)
  1489.  
  1490. PROCEDURE AddResource* [SysBase,-486]
  1491.   ( resource [9] : APTR );
  1492. PROCEDURE RemResource* [SysBase,-492]
  1493.   ( resource [9] : APTR );
  1494. PROCEDURE OpenResource* [SysBase,-498]
  1495.   ( resName [9] : ARRAY OF CHAR )
  1496.   : APTR;
  1497.  
  1498. (* ------private diagnostic support ----------------------------------- *)
  1499.  
  1500. (* ------misc --------------------------------------------------------- *)
  1501.  
  1502. PROCEDURE RawDoFmt* [SysBase,-522]
  1503.   ( formatString [8] : ARRAY OF CHAR;
  1504.     dataStream   [9] : APTR;
  1505.     putChProc   [10] : PROC;
  1506.     putChData   [11] : APTR )
  1507.     : APTR;
  1508. PROCEDURE RawDoFmtL* [SysBase,-522]
  1509.   ( formatString [8] : ARRAY OF CHAR;
  1510.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1511.     putChProc   [10] : PROC;
  1512.     putChData   [11] : APTR )
  1513.     : APTR;
  1514. PROCEDURE OldRawDoFmt* [SysBase,-522]
  1515.   ( formatString [8] : ARRAY OF CHAR;
  1516.     dataStream   [9] : APTR;
  1517.     putChProc   [10] : PROC;
  1518.     putChData   [11] : APTR );
  1519. PROCEDURE OldRawDoFmtL* [SysBase,-522]
  1520.   ( formatString [8] : ARRAY OF CHAR;
  1521.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1522.     putChProc   [10] : PROC;
  1523.     putChData   [11] : APTR );
  1524. PROCEDURE GetCC* [SysBase,-528] ()
  1525.   : s.SET16;
  1526. PROCEDURE TypeOfMem* [SysBase,-534]
  1527.   ( address [9] : APTR )
  1528.   : s.SET32;
  1529. PROCEDURE Procure* [SysBase,-540]
  1530.   ( VAR semaphore [8] : Semaphore;
  1531.     bidMsg        [9] : SemaphoreMessageBasePtr )
  1532.   : BOOLEAN;
  1533. PROCEDURE Vacate* [SysBase,-546]
  1534.   ( VAR semaport [8] : Semaphore );
  1535. PROCEDURE OpenLibrary* [SysBase,-552]
  1536.   ( libName [9] : ARRAY OF CHAR;
  1537.     version [0] : ULONG )
  1538.   : LibraryPtr;
  1539.  
  1540. (* ---functions in V33 or higher (distributed as Release 1.2) --- *)
  1541.  
  1542. (* ------signal semaphores (note funny registers)---------------------- *)
  1543.  
  1544. PROCEDURE InitSemaphore* [SysBase,-558]
  1545.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1546. PROCEDURE ObtainSemaphore* [SysBase,-564]
  1547.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1548. PROCEDURE ReleaseSemaphore* [SysBase,-570]
  1549.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1550. PROCEDURE AttemptSemaphore* [SysBase,-576]
  1551.   ( VAR sigSem [8] : SignalSemaphoreBase )
  1552.   : BOOLEAN;
  1553. PROCEDURE ObtainSemaphoreList* [SysBase,-582]
  1554.   ( VAR sigSem [8] : List );
  1555. PROCEDURE ReleaseSemaphoreList* [SysBase,-588]
  1556.   ( VAR sigSem [8] : List );
  1557. PROCEDURE FindSemaphore* [SysBase,-594]
  1558.   ( sigSem [9] : ARRAY OF CHAR )
  1559.   : SignalSemaphorePtr;
  1560. PROCEDURE AddSemaphore* [SysBase,-600]
  1561.   ( VAR sigSem [9] : SignalSemaphoreBase );
  1562. PROCEDURE RemSemaphore* [SysBase,-606]
  1563.   ( VAR sigSem [9] : SignalSemaphoreBase );
  1564.  
  1565. (* ------kickmem support ---------------------------------------------- *)
  1566.  
  1567. PROCEDURE SumKickData* [SysBase,-612] ()
  1568.   : ULONG;
  1569.  
  1570. (* ------more memory support ------------------------------------------ *)
  1571.  
  1572. PROCEDURE AddMemList* [SysBase,-618]
  1573.   ( size       [0] : ULONG;
  1574.     attributes [1] : s.SET32;
  1575.     pri        [2] : LONGINT;
  1576.     memBase    [8] : APTR;
  1577.     name       [9] : ARRAY OF CHAR );
  1578. PROCEDURE CopyMem* [SysBase,-624]
  1579.   ( source [8] : ARRAY OF SYS.BYTE;
  1580.     dest   [9] : ARRAY OF SYS.BYTE;
  1581.     size   [0] : ULONG );
  1582. PROCEDURE CopyMemAPTR* [SysBase,-624]
  1583.   ( source [8] : APTR;
  1584.     dest   [9] : APTR;
  1585.     size   [0] : ULONG );
  1586. PROCEDURE CopyMemQuick* [SysBase,-630]
  1587.   ( source [8] : ARRAY OF SYS.BYTE;
  1588.     dest   [9] : ARRAY OF SYS.BYTE;
  1589.     size   [0] : ULONG );
  1590. PROCEDURE CopyMemQuickAPTR* [SysBase,-630]
  1591.   ( source [8] : APTR;
  1592.     dest   [9] : APTR;
  1593.     size   [0] : ULONG );
  1594.  
  1595. (* ------cache -------------------------------------------------------- *)
  1596.  
  1597. (* ---functions in V36 or higher (distributed as Release 2.0) --- *)
  1598.  
  1599. PROCEDURE CacheClearU* [SysBase,-636] ();
  1600. PROCEDURE CacheClearE* [SysBase,-642]
  1601.   ( address [8] : APTR;
  1602.     length  [0] : ULONG;
  1603.     caches  [1] : s.SET32 );
  1604. PROCEDURE CacheControl* [SysBase,-648]
  1605.   ( cacheBits [0] : s.SET32;
  1606.     cacheMask [1] : s.SET32 )
  1607.   : s.SET32;
  1608.  
  1609. (* ------misc --------------------------------------------------------- *)
  1610.  
  1611. PROCEDURE CreateIORequest* [SysBase,-654]
  1612.   ( port [8] : MsgPortBasePtr;
  1613.     size [0] : ULONG )
  1614.   : MessagePtr;
  1615. PROCEDURE DeleteIORequest* [SysBase,-660]
  1616.   ( iorequest [8] : MessageBasePtr );
  1617. PROCEDURE CreateMsgPort* [SysBase,-666] ()
  1618.   : MsgPortPtr;
  1619. PROCEDURE DeleteMsgPort* [SysBase,-672]
  1620.   ( port [8] : MsgPortBasePtr );
  1621. PROCEDURE ObtainSemaphoreShared* [SysBase,-678]
  1622.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1623.  
  1624. (* ------even more memory support ------------------------------------- *)
  1625.  
  1626. PROCEDURE AllocVec* [SysBase,-684]
  1627.   ( byteSize     [0] : ULONG;
  1628.     requirements [1] : s.SET32 )
  1629.   : APTR;
  1630. PROCEDURE FreeVec* [SysBase,-690]
  1631.   ( memoryBlock [9] : APTR );
  1632. PROCEDURE CreatePool* [SysBase,-696]
  1633.   ( requirements [0] : s.SET32;
  1634.     puddleSize   [1] : ULONG;
  1635.     puddleThresh [2] : ULONG )
  1636.   : MemPoolPtr;
  1637. PROCEDURE DeletePool* [SysBase,-702]
  1638.   ( poolHeader [8] : MemPoolPtr );
  1639. PROCEDURE AllocPooled* [SysBase,-708]
  1640.   ( poolHeader [8] : MemPoolPtr;
  1641.     memSize    [0] : ULONG )
  1642.   : APTR;
  1643. PROCEDURE FreePooled* [SysBase,-714]
  1644.   ( poolHeader [8] : MemPoolPtr;
  1645.     memory     [9] : APTR;
  1646.     memSize    [0] : ULONG );
  1647.  
  1648. (* ------misc --------------------------------------------------------- *)
  1649.  
  1650. PROCEDURE AttemptSemaphoreShared* [SysBase,-720]
  1651.   ( VAR sigSem [8] : SignalSemaphoreBase )
  1652.   : BOOLEAN;
  1653. PROCEDURE ColdReboot* [SysBase,-726] ();
  1654. PROCEDURE StackSwap* [SysBase,-732]
  1655.   ( VAR newStack [8] : StackSwapStruct );
  1656.  
  1657. (* ------task trees --------------------------------------------------- *)
  1658.  
  1659. PROCEDURE ChildFree* [SysBase,-738]
  1660.   ( tid [0] : APTR );
  1661. PROCEDURE ChildOrphan* [SysBase,-744]
  1662.   ( tid [0] : APTR );
  1663. PROCEDURE ChildStatus* [SysBase,-750]
  1664.   ( tid [0] : APTR );
  1665. PROCEDURE ChildWait* [SysBase,-756]
  1666.   ( tid [0] : APTR );
  1667.  
  1668. (* ------future expansion --------------------------------------------- *)
  1669.  
  1670. PROCEDURE CachePreDMA* [SysBase,-762]
  1671.   ( address    [8] : APTR;
  1672.     VAR length [9] : ULONG;
  1673.     flags      [0] : ULONG )
  1674.   : APTR;
  1675. PROCEDURE CachePostDMA* [SysBase,-768]
  1676.   ( address    [8] : APTR;
  1677.     VAR length [9] : ULONG;
  1678.     flags      [0] : ULONG );
  1679.  
  1680. (*------New, for V39 *)
  1681.  
  1682. (*---functions in V39 or higher (Release 3) --- *)
  1683.  
  1684. (*------Low memory handler functions *)
  1685.  
  1686. PROCEDURE AddMemHandler* [SysBase,-774]
  1687.   ( memhand [9] : InterruptPtr );
  1688. PROCEDURE RemMemHandler* [SysBase,-780]
  1689.   ( memhand [9] : InterruptPtr );
  1690.  
  1691. (*------Function to attempt to obtain a Quick Interrupt Vector... *)
  1692.  
  1693. PROCEDURE ObtainQuickVector* [SysBase,-786]
  1694.   ( interruptCode [8] : PROC )
  1695.   : ULONG;
  1696.  
  1697.  
  1698. (**-----Module initialisation ---------------------------------------- *)
  1699.  
  1700. <*$LongVars-*>
  1701.  
  1702. BEGIN
  1703.   SYS.GET (absExecBase, SysBase); exec := SysBase
  1704. END Exec.
  1705.